package com.dy.dynotinstalled.room;

import android.app.Application;

import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;

import java.util.List;

/**
 * @author Li Xuyang
 * @date : 2019/9/26 19:29
 */
public class NotDoorInformationViewModel extends AndroidViewModel {

    private NotDoorInformationRepository notDoorInformationRepository;

    public NotDoorInformationViewModel(@NonNull Application application) {
        super(application);
        notDoorInformationRepository = new NotDoorInformationRepository(application);
    }

    public LiveData<List<NotDoorInformation>> getAllDoorInformationRepositoryLive() {
        return notDoorInformationRepository.getAllDoorInformationLive();
    }


    public void insertDoorInformation(NotDoorInformation... notDoorInformation) {
        notDoorInformationRepository.insertDoorInformation(notDoorInformation);
    }

    public void updateDoorInformation(NotDoorInformation... notDoorInformation) {
        notDoorInformationRepository.updateDoorInformation(notDoorInformation);
    }

    public void deleteDoorInformation(NotDoorInformation... notDoorInformation) {
        notDoorInformationRepository.deleteDoorInformation(notDoorInformation);
    }

    public void deleteAllDoorInformation() {
        notDoorInformationRepository.deleteAllDoorInformation();
    }
}
